﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="EnlistmentPersonCheck.ascx.vb"
    Inherits="WebForm_ManageEnlistment_EnlistmentPersonCheck" %>
       <script>
Sys.Application.add_load(
 function(sender, eventArgs) {

	$('input[name*="chkAllSignIn"],input[name*="chkAllSignIn"]').click(function(){
		$('input[name*="chkSignIn"]').attr('checked', this.checked);
	});

	$('input[name*="chkAllSignOut"],input[name*="chkAllSignOut"]').click(function(){
		$('input[name*="chkSignOut"]').attr('checked', this.checked);
	});
	


});
</script>
<div align="right">
    
    <asp:Button ID="btnSave" runat="server" Text="<%$ Resources:Save %>" />
    <asp:Button ID="btnExport" runat="server" Text="<%$ Resources:Export %>" />
    </div>
<asp:Panel ID="Panel1" runat="server">
</asp:Panel>
<asp:Panel ID="Panel2" runat="server" GroupingText="<%$ Resources:CheckInfo %>">
    <My:MyGridView ID="GV" runat="server" SkinID="pager" AllowHoverSelect="False" DataKeyNames="CourseID,VolunteerID"
        AllowHoverEffect="False" MySortDirection="Ascending" MouseOverColor="Yellow"
        AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True">
        <Columns>
            <asp:BoundField DataField="VolunteerID" HeaderText="<%$ Resources:VolunteerID %>"
                ReadOnly="True" SortExpression="VolunteerID" />
            <asp:BoundField DataField="VolunteerName" HeaderText="<%$ Resources:VolunteerName %>"
                ReadOnly="True" SortExpression="VolunteerName" />
            <asp:TemplateField meta:resourcekey="bfTrainingBHour" ItemStyle-HorizontalAlign="Center">
                <itemtemplate>
                <%#Eval("TrainingBHour")%>
            </itemtemplate>
            </asp:TemplateField>
            <asp:TemplateField meta:resourcekey="bfTrainingSHour" ItemStyle-HorizontalAlign="Center">
                <itemtemplate>
                <%#Eval("TrainingSHour")%>
            </itemtemplate>
            </asp:TemplateField>
            <asp:TemplateField meta:resourcekey="bfTrainingWHour" ItemStyle-HorizontalAlign="Center">
                <itemtemplate>
                <%#Eval("TrainingWHour")%>
            </itemtemplate>
            </asp:TemplateField>
            <asp:TemplateField meta:resourcekey="bfSignIn">
                        <headertemplate>
                            <asp:Label ID="bfSignIn" runat="server" Text="<%$ Resources:bfSignIn.HeaderText %>"></asp:Label>
                            <asp:CheckBox ID="chkAllSignIn" runat="server" OnCheckedChanged="chkAllSignIn_CheckedChanged"
                                AutoPostBack="true" Checked="true"></asp:CheckBox>
                        </headertemplate>
                        <itemtemplate>
                            <asp:CheckBox ID="chkSignIn" runat="server"></asp:CheckBox>
                        </itemtemplate>
                        <itemstyle horizontalalign="Center" />
             </asp:TemplateField>
            <asp:TemplateField meta:resourcekey="bfSignOut">
                <headertemplate>
                    <asp:Label ID="bfSignOut" runat="server" Text="<%$ Resources:bfSignOut.HeaderText %>"></asp:Label>
                    <asp:CheckBox ID="chkAllSignOut" runat="server" OnCheckedChanged="chkAllSignOut_CheckedChanged"
                        AutoPostBack="true" Checked="true"></asp:CheckBox>
                </headertemplate>
                <itemtemplate>
                    <asp:CheckBox ID="chkSignOut" runat="server"></asp:CheckBox>
                </itemtemplate>
                <itemstyle horizontalalign="Center" />
            </asp:TemplateField>
           <%-- <asp:TemplateField SortExpression="Status">
                <itemtemplate>
                    <asp:CheckBoxList ID="cblStatus" runat="server" 
                        ondatabinding="cblStatus_DataBinding" RepeatDirection="Horizontal">
                        <asp:ListItem>簽到</asp:ListItem>
                        <asp:ListItem>簽退</asp:ListItem>
                    </asp:CheckBoxList>
                </itemtemplate>
            </asp:TemplateField>--%>
        </Columns>
    </My:MyGridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:connStr %>"
        SelectCommand="SELECT A.*,B.VolunteerName,vs.TrainingBHour,vs.TrainingSHour,vs.TrainingWHour,r.RegionID,r.RegionName
FROM EnlistTrainingRecord A
inner join Volunteer B on A.VolunteerID=B.VolunteerID
inner join VolunteerStat vs on B.VolunteerID=vs.VolunteerID
inner join Region r on B.VillageID = r.RegionID
WHERE CourseID=@CourseID
ORDER BY vs.TrainingSHour desc,A.VolunteerID asc">
        <SelectParameters>
            <asp:Parameter Name="CourseID" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Panel>
